local skill = fk.CreateSkill{
  name = "action__liehuo_skill",
}

Fk:loadTranslationTable{
  ["action__liehuo"] = "烈火",
  ["action__liehuo_skill"] = "烈火",
  [":action__liehuo"] = "锦囊牌<br /><b>时机</b>：出牌阶段<br /><b>目标</b>：你 <br /><b>效果</b>：你与其他有手牌的角色同时展示一张手牌，若有角色与你展示的牌颜色相同，你弃置你展示的牌对这些角色各造成一点火焰伤害。（不可响应）",
  ["#action__liehuo_skill"] = "你与其他有手牌的角色同时展示一张手牌，若有角色与你展示的牌颜色相同，你弃置你展示的牌对这些角色各造成一点火焰伤害",
  ["#action__liehuo-show"] = "烈火：展示一张手牌，若与 %src 展示的牌颜色不同，则受到其造成的1点火焰伤害",
}


skill:addEffect("cardskill", {
  mute = true,
  name = "action__liehuo",
  prompt = "#action__liehuo_skill",
  mod_target_filter = Util.TrueFunc,
  can_use = function(self, player, card)
    return not player:isProhibited(player, card) and player:getHandcardNum() > 1
  end,
  on_use = function(self, room, cardUseEvent)
    cardUseEvent.disresponsiveList = table.simpleClone(Fk:currentRoom().players)
    if not cardUseEvent.tos or #cardUseEvent.tos == 0 then
      cardUseEvent.tos = { cardUseEvent.from }
    end
  end,
  on_effect = function(self, room, effect)
    local player = effect.to
    local targets = room:getAlivePlayers()
    room:doIndicate(player, targets)
    targets = table.filter(targets, function (p)
      return not p:isKongcheng()
    end)
    if #targets == 0 then return false end
    local result = room:askToJointCards(player, {
      players = targets,
      min_num = 1,
      max_num = 1,
      include_equip = false,
      skill_name = self.name,
      cancelable = false,
      prompt = "#action__liehuo-show:"..player.id,
    })
    for _, p in ipairs(targets) do
      p:showCards(result[p])
    end
    for _, p in ipairs(targets) do
      local color = Fk:getCardById(result[p][1]).color
      if color ~= Fk:getCardById(result[player][1]).color then
        room:damage({
          from = player,
          to = p,
          damage = 1,
          damageType = fk.FireDamage,
          skillName = skill.name,
        })
      end
    end
  end,
})


return skill